package com.ofsoft.weixin.mp;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ofsoft.weixin.mp.message.DefaultController;

/**
 * 微信服务端验证
 * 
 * @author OF
 * @date 2017年10月10日
 */
@WebServlet(name = "coreInit", loadOnStartup = 1, urlPatterns = { "/wx/sing.html" })
public class Init extends HttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	public void init(ServletConfig config) throws ServletException {
		// 设置配置信息
		// AppConfig.setConfig(appid, appSecret, token);
		AppConfig.getInstance().init(new DefaultController());
	}

	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		Dispatcher.doDispatch(request, response);
	}

}
